package com.zjy.software.javabase;

public class Teacher extends Person{
    public Teacher( String name,int age) {
        super(name,age );
    }

    public  static void main(String[] args)
    {
        Teacher teacher=new Teacher("张三",30);
        teacher.eat();
        System.out.println("teacher = " + teacher);
        System.out.println("teacher.toString() = " + teacher.toString());
        System.out.println(new Student());
    }
    public void eat(){
        System.out.println("老师回家吃饭");
    }
    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + getName() + '\'' +
                ", age=" + getAge() +
                '}';
    }
}
